package com.base.service.impl;

import java.math.BigDecimal;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.base.mapper.voipmapper.SotreMapper;
import com.base.po.voip.Sotre;
import com.base.service.SotreService;
import com.base.utils.Page;

@Service("sotreService")
public class SotreServiceImpl implements SotreService {

	@Autowired
	private SotreMapper sotreMapper;

	@Override
	public int insert(Sotre record) {
		return sotreMapper.insert(record);
	}

	@Override
	public int insertSelective(Sotre record) {
		return sotreMapper.insertSelective(record);
	}

	@Override
	public Sotre selectByPrimaryKey(String id) {
		if (id == null || id.isEmpty()) {
			return null;
		}
		return sotreMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Sotre record) {
		return sotreMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int countByShopAll(String shopid, String mobile, String sotrename, String appname, String username,
			String shopname, Integer status, Integer grade) {
		return sotreMapper.countByShopAll(shopid, mobile, sotrename, appname, username, shopname, status, grade);
	}

	@Override
	public List<Sotre> selectByShopAll(Page page, String shopid, String mobile, String sotrename, String appname,
			String username, String shopname, Integer status, Integer grade) {
		return sotreMapper.selectByShopAll(page, shopid, mobile, sotrename, appname, username, shopname, status, grade);
	}

	@Override
	public int countByParentAll(String parentid, String mobile, String sotrename, String appname, String username,
			String shopname, Integer status, Integer grade) {
		return sotreMapper.countByParentAll(parentid, mobile, sotrename, appname, username, shopname, status, grade);
	}

	@Override
	public List<Sotre> selectByParentAll(Page page, String parentid, String mobile, String sotrename, String appname,
			String username, String shopname, Integer status, Integer grade) {
		return sotreMapper.selectByParentAll(page, parentid, mobile, sotrename, appname, username, shopname, status,
				grade);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		return sotreMapper.deleteByPrimaryKey(id);
	}

	@Override
	public List<Sotre> selectBySotre(Sotre record, Integer type, String shopid) {
		return sotreMapper.selectBySotre(record, type, shopid);
	}

	@Override
	public List<Sotre> selectByNearby(String parentid, BigDecimal latitude, BigDecimal longitude, String shopid, Integer distance) {
		return sotreMapper.selectByNearby(parentid, latitude, longitude, shopid, distance);
	}
}
